Skip to content

Conversation

@ivandevp
Copy link
Collaborator

Description

Add storage size details for databases and collections in a tooltip displayed when hovering over the table cell.

Databases

image

Collections

image

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added
  • If this change updates the UI, screenshots/videos are added and a design review is requested
  • I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@ivandevp ivandevp self-assigned this Oct 30, 2025
@ivandevp ivandevp requested a review from a team as a code owner October 30, 2025 12:15
@ivandevp ivandevp requested review from Copilot and mabaasit October 30, 2025 12:15
@github-actions github-actions bot added the feat label Oct 30, 2025
@ivandevp ivandevp added the no release notes Fix or feature not for release notes label Oct 30, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds tooltips to the storage size column in both the databases and collections lists, providing detailed breakdowns of storage metrics when users hover over the values.

  • Adds interactive tooltips showing storage size details for databases (storage and data size) and collections (storage, used, free, and data size)
  • Refactors the storage size rendering logic to use early returns for cleaner code flow
  • Includes comprehensive test coverage for the new tooltip functionality

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
packages/databases-collections-list/src/databases.tsx Implements tooltip with storage and data size breakdown for database storage cells
packages/databases-collections-list/src/databases.spec.tsx Adds test case to verify database storage tooltip rendering and content
packages/databases-collections-list/src/collections.tsx Implements tooltip with detailed storage breakdown (total, used, free, data size) for collection storage cells
packages/databases-collections-list/src/collections.spec.tsx Adds test case to verify collection storage tooltip rendering and content

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 156 to 157
<strong>Storage Size:</strong> {compactBytes(storageSize)}{' '}
(total allocated)
Copy link

Copilot AI Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The storage size is displayed twice: once in the tooltip trigger (line 149) and again in the tooltip content. Consider removing the redundant display from the tooltip content since users already see this value in the cell, or make it clear why it's repeated.

Suggested change
<strong>Storage Size:</strong> {compactBytes(storageSize)}{' '}
(total allocated)
<strong>Storage Size:</strong> total allocated space

Copilot uses AI. Check for mistakes.
Comment on lines 321 to 324
<strong>Storage Size:</strong> {compactBytes(storageSize)}{' '}
(total allocated)
</div>
<div>
Copy link

Copilot AI Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The storage size is displayed twice: once in the tooltip trigger (line 314) and again in the tooltip content. Consider removing the redundant display from the tooltip content since users already see this value in the cell, or make it clear why it's repeated.

Suggested change
<strong>Storage Size:</strong> {compactBytes(storageSize)}{' '}
(total allocated)
</div>
<div>

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

@addaleax addaleax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@mabaasit
Copy link
Collaborator

mabaasit commented Oct 30, 2025

[nit]: can we somehow highlight that this cell has a tooltip? maybe using InlineDefinition component?

@ivandevp
Copy link
Collaborator Author

ivandevp commented Oct 30, 2025

Great suggestion @mabaasit, here's how it looks with <InlineDefinition /> component.

Databases:

Screenshot 2025-10-30 at 14 37 28

Collections:

Screenshot 2025-10-30 at 14 37 42

Copy link
Collaborator

@mabaasit mabaasit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@ivandevp ivandevp merged commit 642450e into main Nov 3, 2025
84 of 85 checks passed
@ivandevp ivandevp deleted the COMPASS-7691/add-tooltips-to-storage-size branch November 3, 2025 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat no release notes Fix or feature not for release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants